Skip to content

Address tutorial feedback#51518

Open
BillWagner wants to merge 3 commits intodotnet:mainfrom
BillWagner:interpolated-string-handler-fixes
Open

Address tutorial feedback#51518
BillWagner wants to merge 3 commits intodotnet:mainfrom
BillWagner:interpolated-string-handler-fixes

Conversation

@BillWagner
Copy link
Member

@BillWagner BillWagner commented Feb 4, 2026

Fixes #51310

Address all the comments in this issue.

While in this file, perform a general edit pass.


Internal previews

📄 File 🔗 Preview link
docs/csharp/advanced-topics/performance/interpolated-string-handler.md Tutorial: Write a custom string interpolation handler

Fixes dotnet#51310

Address all the comments in this issue.
@BillWagner BillWagner requested a review from a team as a code owner February 4, 2026 22:02
Copilot AI review requested due to automatic review settings February 4, 2026 22:02
@dotnetrepoman dotnetrepoman bot added this to the February 2026 milestone Feb 4, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request addresses all feedback points from issue #51310 regarding the C# interpolated string handler tutorial. The changes improve the tutorial by adding missing implementation details, clarifying behaviors, and simplifying examples.

Changes:

  • Added implementation for AppendFormatted with alignment and format parameters
  • Replaced custom GetFormattedText() method with standard ToString() override in all logger versions
  • Added documentation notes about constant interpolated strings and empty InterpolatedStringHandlerArgumentAttribute behavior
  • Simplified the side-effects demonstration from 5 increments to 1 increment per loop iteration
  • Updated target framework from net8.0 to net10.0

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
logger-v4.cs Added AppendFormatted overload with alignment parameter and replaced GetFormattedText with ToString override
logger-v3.cs Replaced GetFormattedText with ToString override
Logger-v2.cs Replaced GetFormattedText with ToString override
Version_4_Examples.cs Simplified side-effects example to use single increment instead of five
interpolated-string-handler.md Added two notes explaining constant interpolated string behavior and empty attribute behavior; updated expected output
interpolated-string-handler.csproj Updated TargetFramework from net8.0 to net10.0

Do a full proofread and style check.
@BillWagner BillWagner requested a review from adegeo February 5, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feedback on the tutorial "Write a custom string interpolation handler"

1 participant